package com.kun.index.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 附件表
 * </p>
 *
 * @author kunkun
 * @since 2024-02-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("attach")
@ApiModel(value="Attach对象", description="附件表")
public class Attach implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "文件名")
    private String name;


    @ApiModelProperty(value = "文件大小")
    private Long size;

    @ApiModelProperty(value = "文件路径（不包含前缀）")
    private String url;

    @ApiModelProperty(value = "文件类型")
    private String type;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除，1：已经删除，0：未删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "文件的Md5，用于避免文件重复上传，节约空间")
    private String fileMd5;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;


}
